package com.jinglvhuanjing.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.widget.AppCompatButton;

import com.jinglvhuanjing.app.base.CountDownActivity;

public class WasteGradeActivity extends CountDownActivity implements View.OnClickListener {

    public static void startActivity(Activity activity) {
        Intent intent = new Intent(activity, WasteGradeActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_waste_grade;
    }

    @Override
    public void initCountDownText() {
        mCountText = findViewById(R.id.count_down);
    }

    private AppCompatButton excellent_btn, good_btn, commonly_btn, inferior_btn, back_btn;

    @Override
    protected void initView(Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        this.excellent_btn = findViewById(R.id.excellent_btn);
        this.good_btn = findViewById(R.id.good_btn);
        this.commonly_btn = findViewById(R.id.commonly_btn);
        this.inferior_btn = findViewById(R.id.inferior_btn);
        this.back_btn = findViewById(R.id.back_btn);
        setLeftView();

        excellent_btn.setOnClickListener(this);
        good_btn.setOnClickListener(this);
        commonly_btn.setOnClickListener(this);
        inferior_btn.setOnClickListener(this);
        back_btn.setOnClickListener(this);
    }


    @Override
    public void countDownComplete() {
        finish();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.excellent_btn:
                finish();
                break;
            case R.id.good_btn:
                finish();
                break;
            case R.id.commonly_btn:
                finish();
                break;
            case R.id.inferior_btn:
                finish();
                break;
            case R.id.back_btn:
                LoginActivity.startActivity(WasteGradeActivity.this);
                finish();
                break ;
        }
    }
}

